package com.haipumi.listeners;

import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.haipumi.beans.haipumi_product;
import com.haipumi.beans.haipumi_taskType;
import com.haipumi.biz.TaskTypeBiz;
import com.haipumi.biz.impl.TaskTypeBizImpl;
import com.haipumi.utils.CommonData;

public class TaskTypeListener implements ServletContextListener{

	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
	}

	@Override
	public void contextInitialized(ServletContextEvent arg0) {
		//访问数据库,得到所有的商品存到application中
		TaskTypeBiz tt=new TaskTypeBizImpl();
		List<haipumi_taskType> list=tt.findAllTaskType("");
		//如何取出application
		
		ServletContext application=arg0.getServletContext();
		application.setAttribute(CommonData.APPLICATIONTASKTYPE, list);
	}

}
